Skip to content

Simplify UNION ALL with identical expressions but different aliases#69

Merged
kyleconroy merged 2 commits intomainfrom
claude/fix-next-test-WygdO
Dec 28, 2025
Merged

Simplify UNION ALL with identical expressions but different aliases#69
kyleconroy merged 2 commits intomainfrom
claude/fix-next-test-WygdO

Conversation

@kyleconroy
Copy link
Copy Markdown
Collaborator

ClickHouse's EXPLAIN AST output optimizes UNION ALL queries when all
SELECTs have identical expressions but different column aliases. Since
column names come from the first SELECT, subsequent SELECTs are elided
in the AST output.

This adds simplifyUnionSelects() to match this behavior, fixing test
00592_union_all_different_aliases.

ClickHouse's EXPLAIN AST output optimizes UNION ALL queries when all
SELECTs have identical expressions but different column aliases. Since
column names come from the first SELECT, subsequent SELECTs are elided
in the AST output.

This adds simplifyUnionSelects() to match this behavior, fixing test
00592_union_all_different_aliases.
@kyleconroy kyleconroy merged commit f8d2efd into main Dec 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants